// 清空添加数据
const clearAddData = function(){
    const nameValue = document.getElementsByName("nameInput")[0];
    const linkInput = document.getElementsByName("linkInput")[0];
    const dateInput = document.getElementsByName("dateInput")[0];
    nameValue.value = "";
    linkInput.value = "";
    dateInput.value = "";
}
// 清空编辑数据
const clearEditData = function(){
    const editNameInput = document.getElementsByName("editNameInput")[0];
    const editLinkInput = document.getElementsByName("editLinkInput")[0];
    const editDateInput = document.getElementsByName("editDateInput")[0];
    editNameInput.value = "";
    editLinkInput.value = "";
    editDateInput.value = "";
}
/**
 * 打开关闭编辑弹窗
 * @param {Object} param0 函数配置项
 * @param {number} param0.type 类型 1打开 2关闭
 */
const openEditDialog = (function(){
    const modal = document.getElementById('myModal'); 
    return function({type = 1}){  
        let setState = "none";
        switch(type){
            case 1:
                setState = "block";
            break;
            case 2:
                setState = "none";
            break;
        }
        modal.style.display = setState;
    }
})()